package com.yootk.server;
import java.io.*;
import java.net.*;

public class HelloServer {
    public static void main(String[] args) throws Exception {
        ServerSocket serverSocket = new ServerSocket(9999);
        System.out.println("[HelloServer]服务端启动监听......");
        // 每一个连接到服务端的客户端都通过Socket对象来描述，所以此时要等待连接
        Socket client = serverSocket.accept();
        // 向指定的Socket实现数据的输出，所以应该获取Socket输出流
        PrintStream out = new PrintStream(client.getOutputStream());
        out.println("www.yootk.com");
        client.shutdownOutput();
        serverSocket.close();
    }
}